//登录界面
import SignOn from '@/components/sign-on/signOn'
//注册界面
import SignIn from '@/components/sign-in/signIn'
//主界面
import Home from '@/components/home/home'
//首页界面
import HomePage from '@/components/home/home-page/homePage'
//消息界面
import Messages from '@/components/home/messages/messages'
//--客户信息
import Customer from '@/components/home/messages/customerMessage'
//--任务提醒
import Task from '@/components/home/messages/taskManager'
//--公司新闻
import News from '@/components/home/messages/companyNews'
//--促销活动
import Sales from '@/components/home/messages/salesActive'
//会员界面
import Member from '@/components/home/member/member'
//晒图
import Photo from '@/components/home/photo/photo'
//我的
import Mine from '@/components/home/mine/mine'
//--------------我的界面各种选项----------------
// 我的业绩
import MyperFormance from '@/components/mine-page/my-performance/myPerformance'
//我的收入
import MyIncome from '@/components/mine-page/my-income/myIncome'
//我的排名
import MyRanking from '@/components/mine-page/my-ranking/myRanking'
//我的评价
import MyEvaluate from '@/components/mine-page/my-evaluate/myEvaluate'
//我的优惠券
import MyCoupon from '@/components/mine-page/my-coupon/myCoupon'
//我的二维码
import MyCode from '@/components/mine-page/my-code/myCode'
//打卡记录
import Clock from '@/components/mine-page/clock/clock'
//设置
import Setting from '@/components/mine-page/setting/setting'
//--我的业绩 吸粉
import Fans from '@/components/mine-page/my-performance/myFans'
//--我的业绩 业绩
import Achievement from '@/components/mine-page/my-performance/myAchievement'
//--我的业绩 绑定
import Bind from '@/components/mine-page/my-performance/myBind'
//--------------会员界面各种选项----------------
//会员 粉丝列表
import Firend from '@/components/home/member/firendList'
//会员 绑约会员
import Tied from '@/components/home/member/tiedMember'
//会员 解绑会员
import Unbundling from '@/components/home/member/unbundlingMember'
//会员 会员排名
import Ranking from '@/components/home/member/rankingMember'
//会员 会员标签
import Label from '@/components/home/member/labelMember'
//会员 高级筛选
import Screening from '@/components/home/member/screeningUpper'

// 异步加载404模块
var NotFound = function (resolve, reject) {
  require.ensure(['./components/404.vue'], function () {
    resolve(require('./components/404.vue'));
  });
};


let routes = [
  {
    path: '/',
    /*component: SignIn,*/
    component: Member, 
  },
  {
    path: '/signon',
    component: SignOn,
  },
  {
    path: '/signin',
    component: SignIn,
  },
  {
    path: '/home',
    component: Home,
    redirect: '/homePage',
    children: [
      {
        path: '/homePage',
        component: HomePage,
      },
      {
        path: '/messages',
        component: Messages,
        name: "信息",
        redirect: '/messages/customer',
        children: [
          {path: '/messages/customer', component: Customer},
          {path: '/messages/task', component: Task},
          {path: '/messages/news', component: News},
          {path: '/messages/sales', component: Sales}, 
        ]
      },
      {
        path: '/member',
        component: Member,
        redirect: '/member/firend',
        children:[
          {path: '/Member/firend', component: Firend},
          {path: '/Member/tied', component: Tied},
          {path: '/Member/unbundling', component: Unbundling},
          {path: '/Member/ranking', component: Ranking},
          {path: '/Member/label', component: Label},
          {path: '/Member/screening', component: Screening},
        ]
      },
      {path: '/photo', component: Photo},
      {path: '/mine', component: Mine},
    ]
  },
  {
    path: '/myperformance',
    component: MyperFormance,
    redirect: '/myperformance/fans',
        children: [
          {path: '/myperformance/fans', component: Fans},
          {path: '/myperformance/achievement', component: Achievement},
          {path: '/myperformance/bind', component: Bind},
        ]
  },
  {
    path: '/myincome',
    component: MyIncome,
  },
  {
    path: '/myranking',
    component: MyRanking,
  },
  {
    path: '/myevaluate',
    component: MyEvaluate,
  },
  {
    path: '/mycoupon',
    component: MyCoupon,
  },
  {
    path: '/mycode',
    component: MyCode,
  },
  {
    path: '/clock',
    component: Clock,
  },
  {
    path: '/setting',
    component: Setting,
  }
];
// 在最后添加处理 404 路由
routes.push({
  path: '*', // 匹配未找到路由的情况, 类似 404 页面
  component: NotFound,
  meta: {
    hidden: true
  }
});
export default routes;


